package cn.stylefeng.guns.modular.gridsystem.netty.ws;

import cn.stylefeng.guns.modular.gridsystem.config.WsServerConfig;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ssy
 * @date 2023/3/29 11:45
 */
@Component
public class WsServerRun implements CommandLineRunner {

    @Resource
    private WsServerConfig config;

    @Resource
    private WsServer wsServer;

    @Override
    public void run(String... args) throws Exception {
        if(config.isEnable()){
            wsServer.run();
        }
    }
}
